package exsun.jt808.data.kafka_data;

import exsun.jt808.data.base.MsgDirection;
import exsun.jt808.data.util.GsonUtils;
import exsun.jt808.data.util.HostUtil;

import java.util.Date;

public class KafkaHJ212Data <T> extends KafkaDataBase<T>{
    /**
     * 设备id
     */
    private  String devNo;

    MsgDirection direction;

    public KafkaHJ212Data(String devNo, int msgId, String topic, T object, MsgDirection direction){
        this.devNo = devNo;
        this.msgId = msgId;
        this.topic = topic;
        this.object = object;
        this.hostName = HostUtil.hostName;
        this.direction = direction;
        this.date = new Date();
    }

    public String getJsonFromObject(){
        return GsonUtils.getJsonFromObject(this);
    }
}
